<template>
  <a-modal
    width="100%"
    :closable="false"
    :keyboard="false"
    :maskClosable="false"
    :visible="visible"
    :confirmLoading="loading"
    :footer="null"
    wrapClassName="full-modal"
  >
    <div class="waitingLoading">
      <a-spin :spinning="true" size="large" tip="操作 正在  执行中 . . . . . .请勿刷新页面 , 耐心等待."></a-spin>
    </div>
  </a-modal>
</template>

<script>
export default {
  name: 'WaitingLoad',
  data () {
    return {
      visible: false,
      loading: false
    }
  },
  watch: {
    visible () {
      if (this.visible) {
        this.loading = true
      } else {
        this.loading = false
      }
    }
  },
  methods: {
    openForm () {
      this.visible = true
      this.loading = true
    },
    closeForm () {
      this.loading = false
      this.visible = false
    }
  }

}
</script>
<style lang="less">
.full-modal {
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }

  .ant-modal-content {
    background-color: transparent;
    display: flex;
    flex-direction: column;
    height: calc(100vh);
  }

  .ant-modal-body {
    flex: 1;
  }
}
.waitingLoading{
  margin: 22% auto;
  padding: 0;
  width: 160px;
  height: 60px;
}
</style>
